package com.jxw.launcher.util;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import com.google.android.exoplayer2.C;
import java.io.File;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;

/* loaded from: classes.dex */
public class SystemToolApi {
    public static void sysMusic(Context context) {
        Intent intent = new Intent("android.intent.action.MUSIC_PLAYER");
        intent.setFlags(C.ENCODING_PCM_MU_LAW);
        context.startActivity(intent);
    }

    public static void sysRadio(Context context) {
        Intent intent = new Intent();
        intent.setClassName("com.android.fmradio", "com.android.fmradio.FmMainActivity");
        intent.setFlags(C.ENCODING_PCM_MU_LAW);
        context.startActivity(intent);
    }

    public static void sysRecord(Context context) {
        Intent intent = new Intent("android.provider.MediaStore.RECORD_SOUND");
        intent.setFlags(C.ENCODING_PCM_MU_LAW);
        context.startActivity(intent);
    }

    public static void sysAlarm(Context context) {
        context.startActivity(new Intent("android.intent.action.SET_ALARM"));
    }

    public static void sysSendMsg(Context context) {
        context.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("smsto:")));
    }

    public static void sysCall(Context context) {
        context.startActivity(new Intent("android.intent.action.CALL_BUTTON"));
    }

    public static void sysNet(Context context) {
        context.startActivity(new Intent("android.settings.WIRELESS_SETTINGS"));
    }

    public static void openPDFInBrowser(Context context, String str) {
        Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
        intent.putExtra("com.android.browser.application_id", context.getPackageName());
        try {
            context.startActivity(intent);
        } catch (ActivityNotFoundException unused) {
            Log.w(IjkMediaPlayer.OnNativeInvokeListener.ARG_ERROR, "Activity was not found for intent, " + intent.toString());
        }
    }

    public static void openPDFInNative(Context context, String str) {
        File file = new File(context.getExternalCacheDir(), str);
        Intent intent = new Intent("android.intent.action.VIEW");
        Uri fromFile = Uri.fromFile(file);
        intent.addFlags(C.ENCODING_PCM_MU_LAW);
        intent.setDataAndType(fromFile, "application/pdf");
        try {
            context.startActivity(intent);
        } catch (ActivityNotFoundException unused) {
            Log.w("URLSpan", "Activity was not found for intent, " + intent.toString());
        }
    }
}
